<template>
	<view class="con">
		<view class="addrbox flex">
			<view class="addrbox_left flex">
				<image class="addr_icon" src="/static/img/product/dingwei.png" mode=""></image>
				
				<view class="left_right">
					<view class="addr_name">
						{{addr.detail}}
					</view>
					<view class="contacts">
						{{addr.username}} <text style="color: #7F7F7F;margin-left: 16rpx;">{{addr.mobile}}</text>
					</view>
				</view>
			</view>
			<image class="right_icon" src="/static/img/my/right.png" mode=""></image>
		</view>
		<view class="infobox">
			<view class="dianp flex">
				<image class="dpicon" src="/static/img/product/shangjia.png" mode=""></image>
				{{proinfo.storeName}}
				<image class="dpright" src="/static/img/my/right.png" mode=""></image>
			</view>
			<view class="proinfo flex">
				<image class="propic" :src="proinfo.pic" mode=""></image>
				<view class="inforight">
					<view class="proname">
						{{proinfo.p_name}}
					</view>
					<view class="infolb flex">
						<view class="price flex">
							<text v-if="proinfo.method==0||proinfo.method==1||proinfo.method==2" style="font-size: 28rpx;color: #FF4E31;font-weight: bold;">￥</text>
							<image v-if="proinfo.method==4	" style="width: 22rpx;height: 22rpx;" src="/static/img/proitem/jf.png"
								mode=""></image>
							<image v-if="proinfo.method==3" style="width: 22rpx;height: 22rpx;" src="/static/img/proitem/tz.png"
								mode=""></image>
							<text style="font-size: 36rpx;color: #FF4E31;font-weight: bold;">{{proinfo.price}}</text>
						</view>
					</view>
					<view class="ggbox">
						数量×{{proinfo.num||2}}
						<text style="margin-left: 26rpx;">[{{spec}}]</text>
						
					</view>
					
				</view>
			</view>
		</view>
		<view class="conbox">
			<view class="conitem">
				<view class="left">
					订单编号
				</view>
				<view class="right">
					{{proinfo.out_trade_no}}
				</view>
			</view>
			<view class="conitem">
				<view class="left">
					支付方式
				</view>
				<view class="right" v-if="proinfo.method==0">
					支付宝
				</view>
				<view class="right" v-if="proinfo.method==1">
					微信
				</view>
				<view class="right" v-if="proinfo.method==2">
					惠积分
				</view>
				<view class="right" v-if="proinfo.method==3">
					惠值积分
				</view>
				<view class="right" v-if="proinfo.method==4">
					贡献值
				</view>
			</view>
			<view class="conitem">
				<view class="left">
					价格合计
				</view>
				<view class="right">
					<text v-if="proinfo.method==0||proinfo.method==1||proinfo.method==2">￥</text>
					<image v-if="proinfo.method==4" style="width: 22rpx;height: 22rpx;" src="/static/img/proitem/jf.png"
						mode=""></image>
					<image v-if="proinfo.method==3" style="width: 22rpx;height: 22rpx;" src="/static/img/proitem/tz.png"
						mode=""></image>
					{{proinfo.price*proinfo.num||2}}
				</view>
			</view>
			<view class="conitem">
				<view class="left">
					下单时间
				</view>
				<view class="right">
					{{$u.timeFormat(proinfo.paytime, 'yyyy-mm-dd hh:MM')}}
					<!-- {{proinfo.paytime}} -->
				</view>
			</view>
			<view class="conitem">
				<view class="left">
					物流公司
				</view>
				<view class="right">
					{{proinfo.company||''}}
				</view>
			</view>
			<view class="conitem">
				<view class="left">
					快递单号
				</view>
				<view class="right">
					{{proinfo.express||''}}
				</view>
			</view>
			<view class="conitem">
				<view class="left">
					发货时间
				</view>
				<view class="right">
					{{proinfo.sendtime||''}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getAddressById
	} from '@/api/my.js'
	import {
		productById,
		getSpec,
		orderDetail
	} from '@/api/product.js'
	import {
		product
	} from '@/api/home.js'
	export default {
		data() {
			return {
				proinfo: {},
				addr: {},
				spec:''
			};
		},
		methods: {
			
		},
		onLoad(option) {
			orderDetail({orderid:option.id}).then(res=>{
				// console.log(res)
				this.proinfo=res.data.data.list
				this.proinfo.pic=this.$BASE_URL+res.data.data.list.p_image.split(',')[0]
				this.addr=res.data.data.address
				// 获取规格
				getSpec({id:this.proinfo.spec_id||42}).then(res1=>{
					console.log(res1)
					this.spec=res1.data.data.text
				})
			})
		},
		onShow() {
			
		}
	}
</script>

<style lang="less">
	page {
		background-color: #F7F7F9;
	}

	.con {
		padding: 22rpx 28rpx;
	}

	.addrbox {
		background-color: #fff;
		padding: 31rpx 25rpx;
		justify-content: space-between;

		border-radius: 26rpx;

		.addrbox_left {

			.addr_icon {
				width: 36rpx;
				height: 41rpx;
				margin-right: 14rpx;
			}

			.left_right {

				.addr_name {
					color: #232323;
					font-size: 32rpx;
					font-weight: bold;
				}

				.contacts {
					margin-top: 4rpx;
					color: #707070;
					font-size: 26rpx;
				}
			}

		}

		.right_icon {
			width: 15rpx;
			height: 24rpx;
		}
	}

	.infobox {
		padding: 36rpx 52rpx 39rpx 22rpx;
		border-radius: 26rpx;
		background-color: #fff;
		margin-top: 25rpx;

		.dianp {
			font-size: 24rpx;
			color: #616161;

			.dpicon {
				width: 28rpx;
				height: 26rpx;
				margin-right: 10rpx;
			}

			.dpright {
				width: 12rpx;
				height: 20rpx;
				margin-left: 8rpx;
			}
		}
	}

	.proinfo {
		margin-top: 38rpx;

		.propic {
			width: 140rpx;
			height: 140rpx;
			border-radius: 20rpx;
			margin-right: 24rpx;
		}

		.inforight {
			height: 140rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			flex: 1;

			.proname {
				font-size: 32rpx;
				color: #333333;
				font-weight: bold;
			}

			.ggbox {
				color: #6A6A6A;
				font-size: 24rpx;
			}

			.infolb {
				justify-content: space-between;
			}
		}
	}

	.conbox{
		background: #FFFFFF;
		border-radius: 25rpx;
		padding: 7rpx 31rpx 0;
		margin-top: 23rpx;
		.conitem{
			display: flex;
			align-items: center;
			justify-content: space-between;
			color: #707070;
			font-size: 28rpx;
			border-bottom: 1rpx solid #F1F1F1;
			padding: 36rpx 0;
		}
	}

	.footer {
		width: calc(750rpx - 62rpx);
		position: fixed;
		bottom: 0;
		left: 0;
		height: 114rpx;
		background-color: #fff;
		display: flex;
		align-items: center;
		padding: 0 26rpx 20rpx 36rpx;
		justify-content: space-between;

		.allnum {
			color: #979797;
			font-size: 25.01rpx;
			line-height: 114rpx;
			margin-right: 28rpx;
		}

		.allprice {
			color: #333333;
			line-height: 114rpx;
			font-size: 29rpx;
		}

		.btn {
			width: 234rpx;
			line-height: 80rpx;
			background: linear-gradient(90deg, #FF8717, #FF5F00);
			border-radius: 40rpx;
			text-align: center;
			font-size: 30rpx;
			font-weight: bold;
			color: #fff;
		}
	}

	.flex {
		display: flex;
		align-items: center;
	}

	.u-number-box {
		border-radius: 10rpx;

		border: 1rpx solid #DFDFDF;
	}

	.minus {
		width: 51rpx;
		height: 46rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		border-right: 1rpx solid #DFDFDF;

		.jian {
			width: 14rpx;
			height: 2rpx;
		}
	}

	.plus {
		width: 51rpx;
		height: 46rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		border-left: 1rpx solid #DFDFDF;

		.jia {
			width: 16rpx;
			height: 16rpx;
		}
	}
</style>
